package com.credit.management.system.generator.dao;

import com.credit.management.system.model.Syauthority;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SyauthorityMapper {
    @Delete({
        "delete from syauthority",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into syauthority (id, pid, ",
        "name, icon, src, ",
        "seq, grand, permission_sign, ",
        "open)",
        "values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, ",
        "#{name,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{src,jdbcType=VARCHAR}, ",
        "#{seq,jdbcType=INTEGER}, #{grand,jdbcType=INTEGER}, #{permissionSign,jdbcType=VARCHAR}, ",
        "#{open,jdbcType=VARCHAR})"
    })
    int insert(Syauthority record);

    int insertSelective(Syauthority record);

    @Select({
        "select",
        "id, pid, name, icon, src, seq, grand, permission_sign, open",
        "from syauthority",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.credit.management.system.generator.dao.SyauthorityMapper.BaseResultMap")
    Syauthority selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Syauthority record);

    @Update({
        "update syauthority",
        "set pid = #{pid,jdbcType=VARCHAR},",
          "name = #{name,jdbcType=VARCHAR},",
          "icon = #{icon,jdbcType=VARCHAR},",
          "src = #{src,jdbcType=VARCHAR},",
          "seq = #{seq,jdbcType=INTEGER},",
          "grand = #{grand,jdbcType=INTEGER},",
          "permission_sign = #{permissionSign,jdbcType=VARCHAR},",
          "open = #{open,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Syauthority record);
}